package com.ndp.fb.mongo.model;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serializable;

import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.commons.lang3.StringUtils;

/**
 * Created by hunk.qin on 2016/4/12.
 */

@Setter
@Getter
@NoArgsConstructor
public class Feed implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 7704721250189943195L;
	public String feedId = "";
	public String id = "";
	public String availability = "";
	public String condition = "";
	public String description = "";
	public String image_link = "";
	public String link = "";
	public String title = "";
	public String price = "";
	public String gtin = "";
	public String mpn = "";
	public String brand = "";
	public String mobile_link = "";
	public String additional_image_link = "";
	public String age_group = "";
	public String color = "";
	public String expiration_date = "";
	public String gender = "";
	public String item_group_id = "";
	public String google_product_category = "";
	public String material = "";
	public String pattern = "";
	public String size = "";
	public String size_type = "";
	public String size_system = "";
	public String product_type = "";
	public String sale_price = "";
	public String sale_price_effective_date = "";
	public String shipping = "";
	public String shipping_weight = "";
	public String shipping_size = "";
	public String shipping_label = "";
	public String multipack = "";
	public String is_bundle = "";
	public String adult = "";
	public String custom_label_0 = "";
	public String custom_label_1 = "";
	public String custom_label_2 = "";
	public String custom_label_3 = "";
	public String custom_label_4 = "";

	public String materielId = "";

	public String updateDate = "";
	public Long price_amount = 0L;
	public Long sale_price_amount = 0L;
	public String currency = "";

	public String toXmlString() {
		StringBuilder sb = new StringBuilder("<item>");
		sb.append("<g:id>").append(id).append("</g:id>");
		sb.append("<g:availability>").append(StringEscapeUtils.escapeXml10(availability)).append("</g:availability>");
		sb.append("<g:condition>").append(StringEscapeUtils.escapeXml10(condition)).append("</g:condition>");
		sb.append("<g:description>").append(StringEscapeUtils.escapeXml10(description)).append("</g:description>");
		sb.append("<g:image_link>").append(StringEscapeUtils.escapeXml10(image_link)).append("</g:image_link>");
		sb.append("<g:link>").append(StringEscapeUtils.escapeXml10(link)).append("</g:link>");
		sb.append("<g:title>").append(StringEscapeUtils.escapeXml10(title)).append("</g:title>");
		sb.append("<g:price>").append(StringEscapeUtils.escapeXml10(price)).append("</g:price>");
		if (StringUtils.isNotBlank(gtin))
			sb.append("<g:gtin>").append(StringEscapeUtils.escapeXml10(gtin)).append("</g:gtin>");
		if (StringUtils.isNotBlank(mpn))
			sb.append("<g:mpn>").append(StringEscapeUtils.escapeXml10(mpn)).append("</g:mpn>");
		if (StringUtils.isNotBlank(brand))
			sb.append("<g:brand>").append(StringEscapeUtils.escapeXml10(brand)).append("</g:brand>");
		if (StringUtils.isNotBlank(mobile_link))
			sb.append("<g:mobile_link>").append(StringEscapeUtils.escapeXml10(mobile_link)).append("</g:mobile_link>");
		if (StringUtils.isNotBlank(additional_image_link))
			sb.append("<g:additional_image_link>").append(StringEscapeUtils.escapeXml10(additional_image_link))
					.append("</g:additional_image_link>");
		if (StringUtils.isNotBlank(age_group))
			sb.append("<g:age_group>").append(StringEscapeUtils.escapeXml10(age_group)).append("</g:age_group>");
		if (StringUtils.isNotBlank(color))
			sb.append("<g:color>").append(StringEscapeUtils.escapeXml10(color)).append("</g:color>");
		if (StringUtils.isNotBlank(expiration_date))
			sb.append("<g:expiration_date>").append(StringEscapeUtils.escapeXml10(expiration_date))
					.append("</g:expiration_date>");
		if (StringUtils.isNotBlank(gender))
			sb.append("<g:gender>").append(StringEscapeUtils.escapeXml10(gender)).append("</g:gender>");
		if (StringUtils.isNotBlank(item_group_id))
			sb.append("<g:item_group_id>").append(StringEscapeUtils.escapeXml10(item_group_id))
					.append("</g:item_group_id>");
		if (StringUtils.isNotBlank(google_product_category))
			sb.append("<g:google_product_category>").append(StringEscapeUtils.escapeXml10(google_product_category))
					.append("</g:google_product_category>");
		if (StringUtils.isNotBlank(material))
			sb.append("<g:material>").append(StringEscapeUtils.escapeXml10(material)).append("</g:material>");
		if (StringUtils.isNotBlank(pattern))
			sb.append("<g:pattern>").append(StringEscapeUtils.escapeXml10(pattern)).append("</g:pattern>");
		if (StringUtils.isNotBlank(size))
			sb.append("<g:size>").append(StringEscapeUtils.escapeXml10(size)).append("</g:size>");
		if (StringUtils.isNotBlank(size_type))
			sb.append("<g:size_type>").append(StringEscapeUtils.escapeXml10(size_type)).append("</g:size_type>");
		if (StringUtils.isNotBlank(size_system))
			sb.append("<g:size_system>").append(StringEscapeUtils.escapeXml10(size_system)).append("</g:size_system>");
		if (StringUtils.isNotBlank(product_type))
			sb.append("<g:product_type>").append(StringEscapeUtils.escapeXml10(product_type))
					.append("</g:product_type>");
		if (StringUtils.isNotBlank(sale_price))
			sb.append("<g:sale_price>").append(StringEscapeUtils.escapeXml10(sale_price)).append("</g:sale_price>");
		if (StringUtils.isNotBlank(sale_price_effective_date))
			sb.append("<g:sale_price_effective_date>").append(StringEscapeUtils.escapeXml10(sale_price_effective_date))
					.append("</g:sale_price_effective_date>");
		if (StringUtils.isNotBlank(shipping))
			sb.append(shipping);
		if (StringUtils.isNotBlank(shipping_weight))
			sb.append("<g:shipping_weight>").append(StringEscapeUtils.escapeXml10(shipping_weight))
					.append("</g:shipping_weight>");
		if (StringUtils.isNotBlank(shipping_size))
			sb.append("<g:shipping_size>").append(StringEscapeUtils.escapeXml10(shipping_size))
					.append("</g:shipping_size>");
		if (StringUtils.isNotBlank(shipping_label))
			sb.append("<g:shipping_label>").append(StringEscapeUtils.escapeXml10(shipping_label))
					.append("</g:shipping_label>");
		if (StringUtils.isNotBlank(multipack))
			sb.append("<g:multipack>").append(StringEscapeUtils.escapeXml10(multipack)).append("</g:multipack>");
		if (StringUtils.isNotBlank(is_bundle))
			sb.append("<g:is_bundle>").append(StringEscapeUtils.escapeXml10(is_bundle)).append("</g:is_bundle>");
		if (StringUtils.isNotBlank(adult))
			sb.append("<g:adult>").append(StringEscapeUtils.escapeXml10(adult)).append("</g:adult>");
		if (StringUtils.isNotBlank(custom_label_0))
			sb.append("<g:custom_label_0>").append(StringEscapeUtils.escapeXml10(custom_label_0))
					.append("</g:custom_label_0>");
		if (StringUtils.isNotBlank(custom_label_1))
			sb.append("<g:custom_label_1>").append(StringEscapeUtils.escapeXml10(custom_label_1))
					.append("</g:custom_label_1>");
		if (StringUtils.isNotBlank(custom_label_2))
			sb.append("<g:custom_label_2>").append(StringEscapeUtils.escapeXml10(custom_label_2))
					.append("</g:custom_label_2>");
		if (StringUtils.isNotBlank(custom_label_3))
			sb.append("<g:custom_label_3>").append(StringEscapeUtils.escapeXml10(custom_label_3))
					.append("</g:custom_label_3>");
		if (StringUtils.isNotBlank(custom_label_4))
			sb.append("<g:custom_label_4>").append(StringEscapeUtils.escapeXml10(custom_label_4))
					.append("</g:custom_label_4>");
		sb.append("</item>");
		return sb.toString();
	}

}
